// src/app/page.tsx
import {Metadata} from "next";
import Sidebar from "./_components/sidebar";
import Feed from "./_components/feed";
import Widgets from "./_components/widgets";
import CommendModal from "./_components/commendModal";
import {getNews} from "@/data/forum/news";
import {getUsers} from "@/data/forum/user";
import {useUsersStore} from "@/hooks/forum/use-users-store";

export const metadata: Metadata = {
    title: '就业论坛',
    icons: '/logo.png',
    description: '大学生就业交流论坛',
}

export default async function Home() {
    const articles = await getNews()
    const users = await getUsers()
    // const {setUsers} = useUsersStore()
    // setUsers(users)

    return (
        <div>
            <main className={'flex min-h-screen mx-auto'}>
                {/*sidebar*/}
                <Sidebar/>

                {/*feed*/}
                {/*@ts-ignore*/}
                <Feed/>

                {/*widgets*/}
                <Widgets
                    users={users}
                    articles={articles}/>

                {/*modal*/}
                <CommendModal/>
            </main>
        </div>
    );
}
